package com.example.baserecyclerviewadapterdemo.activity.multi;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.baserecyclerviewadapterdemo.R;
import com.example.baserecyclerviewadapterdemo.adapter.DelegateMultiAdapter;
import com.example.baserecyclerviewadapterdemo.base.BaseActivity;
import com.example.baserecyclerviewadapterdemo.data.DataServer;

public class MultiItemDelegateActivity extends BaseActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_multiple_item_use);
        getParentToolbar().setTitle("MultiItemDelegate Use");
        getParentToolbar().setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        final RecyclerView recyclerView = findViewById(R.id.rv_list);
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        DelegateMultiAdapter adapter = new DelegateMultiAdapter(DataServer.getDelegateMultiItemData());
        recyclerView.setAdapter(adapter);
    }
}
